package com.yanglei.controller;

import com.yanglei.service.PaymentServiceHystrix;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class HystrixController {

    @Resource
    private PaymentServiceHystrix paymentServiceHystrix;

    @GetMapping("/ok/{id}")
    public String paymentInfo_ok(@PathVariable("id") String id) {
        return paymentServiceHystrix.paymentInfo_ok(id);
    }

    @GetMapping("/no/{id}")
    public String paymentInfo_No(@PathVariable("id") String id) throws InterruptedException {
        return paymentServiceHystrix.paymentInfo_No(id);
    }

}
